import { post, get, put, del } from "../../../utils/request";
import { getCurrentTenant } from "../../../utils/utils";

export const getList = data =>
  post("mgt/base/receive/group/list", {
    ...data,
    tenantCodeList: (getCurrentTenant() || { tenantCode: "" }).tenantCode
  });
export const addList = data =>
  post("mgt/base/receive/group", {
    ...data,
    tenantCode: (getCurrentTenant() || { tenantCode: "" }).tenantCode[0]
  });
export const updateStatus = data =>
  put("mgt/base/receive/group", {
    ...data,
    tenantCode: (getCurrentTenant() || { tenantCode: "" }).tenantCode[0]
  });
export const deleteReceive = data =>
  del(`mgt/base/receive/group?id=${data.id}`);
export const get4AChildOrgByParentOrgId = data => get("mgt/4A/orgs", data);
export const get4APositionByOrgId = orgId => get(`mgt/4A/positions/${orgId}`);
export const get4AUsersByOrgId = data => get("mgt/4A/selectUserByOrg", data);
export const get4ARoles = data => get("mgt/4A/selectRoleByPage", data);
export const getDetail = data =>
  get("mgt/base/receive/group/detail", data);
